<template>
  <!-- 模板内容：只能有一个div  -->
  <div>
    <div class="contentmenu">
      <ul>
        <li v-for="(item,index) in list" :key="index">
          <div class="smallbox">
            <h2>{{item.bookName}}</h2>
            <h3>{{item.sort}}</h3>
            <img :src="item.imgSrc" alt="" />
            <h5 >1位朋友正在读</h5>
          </div>
        </li>
      </ul>
    </div>
  </div>
</template>
<script>
import axios from "axios";
export default {
  name: "Theme",
   data() {
    return {
      list: [],
    };
  },
  methods: {
    async fn_getData() {
      let { data } = await axios.get("./wechatBook.json");
      this.list = data.bookshelf;
    },
  },
  created() {
    this.fn_getData();
  },
};
</script>

<style scoped>
/* css样式 */
.contentmenu {
  background: #eee;
}
.smallbox {
  width: 90%;
  margin: 5%;
  height: 8rem;
  background: #fff;
  border: 1px solid #fff;
  border-radius: 0.2rem;
  text-align: center;
}
h2 {
  font-size: 0.5rem;
  text-align: center;
  font-weight: normal;
}
h3 {
  font-size: 0.2rem;
  text-align: center;
  font-weight: normal;
}
input {
  width: 5rem;
  height: 0.7rem;
  font-size: 0.3rem;
  background: lightblue;
}
h5 {
  font-size: 0.3rem;
  text-align: center;
  line-height: 1rem;
  background-color: #c6c6c6;
  border-radius: 0rem 0rem .2rem .2rem; 
  margin-top: 1.6rem;
  font-weight: normal;
}
img {
  width: 3.5rem !important;
  height: 3.2rem !important;
}

</style>